/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package task06;

/**
 *
 * @author Administrator
 */
public class FaxSalary {
    
    public static double getSalaryAfterFax(double rawSalary){
        // 原始工资-2000；
        // 纳税部分工资处于哪一档
        // 计算应缴纳的税额
        // 原始工资-纳税税额 等于税后工资
        
        double salary = rawSalary - 2000;
        double fax = 0;
        if(salary>=100000){
            fax = salary*0.45-15375;
        }else if( salary >= 80000 ){
            fax = salary*0.4-10375;
        }else if( salary >= 60000 ){
            fax = salary*0.35-6375;
        }else if( salary >= 40000 ){
            fax = salary*0.30-3375;
        }else if( salary >= 20000 ){
            fax = salary*0.25-1375;
        }else if( salary >= 5000 ){
            fax = salary*0.20-375;
        }else if( salary >= 2000 ){
            fax = salary*0.15-125;
        }else if( salary >= 500 ){
            fax = salary*0.10-25;
        }else{
            fax = salary*0.05;
        }
               
        return rawSalary - fax;
    }
    
    public static void main(String[] args) {
        double raw = 9000;
        System.out.println(raw + "工资对应的税后工资是"+getSalaryAfterFax(raw));
    }

}
